<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "buyer_cashback_pic".
 *
 * @property int $id
 * @property int $buyer_cashback_id
 * @property int $pic_id
 */
class BuyerCashbackPic extends \yii\db\ActiveRecord
{
    //关联
    public function getPic(){
        return $this->hasOne(UploadFile::className(),['id'=>'pic_id']);
    }
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'buyer_cashback_pic';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['buyer_cashback_id', 'pic_id'], 'required'],
            [['buyer_cashback_id', 'pic_id'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'buyer_cashback_id' => 'Buyer Cashback ID',
            'pic_id' => 'Pic ID',
        ];
    }
}
